package com.nanhai.buddhist.college.module.system.dal.mysql.rolegroup;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.system.dal.dataobject.rolegroup.RoleGroupDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.system.controller.admin.rolegroup.vo.*;

/**
 * 群组管理 Mapper
 *
 * @author 南海佛学院
 */
@Mapper
public interface RoleGroupMapper extends BaseMapperX<RoleGroupDO> {

    default PageResult<RoleGroupDO> selectPage(RoleGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RoleGroupDO>()
                .likeIfPresent(RoleGroupDO::getGroupName, reqVO.getGroupName())
                .betweenIfPresent(RoleGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RoleGroupDO::getId));
    }

    default List<RoleGroupDO> selectList(RoleGroupExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<RoleGroupDO>()
                .likeIfPresent(RoleGroupDO::getGroupName, reqVO.getGroupName())
                .betweenIfPresent(RoleGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RoleGroupDO::getId));
    }

}
